import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
let store = new Vuex.Store({
    state:{
        taskName:'',//任务名称
        taskType:'',//任务类型
        marineBoard:'',//海事局
        radarStation:'',//雷达站
        implementDest:'',//计划日期
        taskContent:'',//任务内容
        presenter:"",//实施对象
        startDate:"",//开始时间
        endDate:"",//结束时间
        id:"",//任务id

        //token值
        _token:0,

        //用户登陆信息
        loginName:"",//登陆名
        userName:"",//用户名
        email:"",//邮箱
        personId:"",//用户id
        marineBoardCode:"",//所属海事局编号
        marine_board_code_text:"",//所属海事局名称
        password:"",//密码
        phone:'',//电话
        roleId:"",//角色id
        roleName:"",//角色名
        status:""//	状态
    },
    mutations:{
        change:function(state,data){
            if(state.loginName == ''){
                state.loginName = localStorage.getItem("_loginName");
            }
            state._token = data._token;
            
            state.userName = data.userName;
            state.email = data.email;
            state.personId = data.personId;
            state.marineBoardCode = data.marineBoardCode;
            state.marine_board_code_text = data.marine_board_code_text;
            state.password = data.password;
            state.phone = data.phone;
            state.roleId = data.roleId;
            state.roleName = data.roleName;
            state.status = data.status;
        },
        changData(state,data){
            state.taskName = data.taskName;
            state.taskType = data.taskType;
            state.marineBoard = data.marineBoard;
            state.radarStation = data.radarStation;
            state.implementDest = data.implementDest;
            state.taskContent = data.taskContent;
            state.presenter = data.presenter;
            state.startDate = data.startDate;
            state.endDate = data.endDate;
            state.id = data.id
        }
    }
})
//输出
export default store;